package com.beta.cust.bind.datasync.job;

import com.beta.cust.bind.datasync.config.CfgSelfRefreshBean;
import com.beta.cust.bind.datasync.service.wechat.SyncWechatInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/**
 * @Auther: pcc
 * @Date: 2024/3/12 15:08
 * @Description:
 */
@Slf4j
@Component
public class SyncWechatTask {

    @Resource
    private SyncWechatInfo syncWechatInfo;

    @Autowired
    private CfgSelfRefreshBean cfgSelfRefreshBean;

    @Scheduled(cron = "0 0 0/2 * * ?")
    public void syncCustInfo() {
        log.info("手动定时同步企微用户部门信息start");
        syncWechatInfo.syncWechatInfoBatch(cfgSelfRefreshBean.getCorpId());
        log.info("手动定时同步企微用户部门信息end");
    }
}
